Tell the Story
sidescroller comes from the idea that presentations are meant to be stories.
Most presentation tools that exist are now a crutch that allows the user to throw up some text and images on a slide with no connection to the flow of the story.
By assembling your presentation as a series of connected panels you are able to create a rich story.
To get started, begin by installing {sidescroller} from github:
# install.packages("remotes")
remotes::install_github("thebioengineer/sidescroller")
After installing {sidescroller}, open a new r script file to begin, and load the namespace.
library(sidescroller)
The first Step to creating a presentation is to use sidescroller() and assign it to an object.
pres <- sidescroller()
To build up your presentation, use the family of slide functions that come natively built into the package.
The list of available functions for creating your slides are as follow:
The slide_* functions are wrappers around the slide() function that are opinionated and designed to facilitate the generation of presentations with the least friction.
For example, the slides we are currently going through are an example of using slide_multipanel().
title_slide() is for creating the title slide of the presentation, or for separating and creating ‘chapters’ in the slides.
These slides are the full width of the presentation window.
There can be a number of subtitles passed through the subtitle argument, each subtitle is an entry in a character vector.
slide() is the least opinionated function to use when generating a slide.
htmltools package is loaded to the namespace to provide the necessary tools for creating the html from within an R script.slide_markdown() is for creating the slide contents by writing in markdown to get around needing to have knowledge of html.
R users are comfortable writing markdown from the rmarkdown and xaringan packages, this is a natural way to make slide creation.slide_wide() and slide_wide_markdown() are for creating slides that are the full width of the presentation window.
This is MOST similar to the current presentation format that most other slide presentations take.
Similarly to slide() and slide_markdown(), the slide_wide() function uses html tags to create content, and slide_wide_markdown() uses markdown.
slide_multipanel() is the most unique aspect of {slidescroller}, in that it can have progressive contents.
The contents of this slide is built from either panel() or panel_markdown() functions.
They help simulate the idea of stories by having a single title for a series of panels that progressively appear.
Like the other variants of functions, panel() accepts html tags, and panel_markdown() uses markdown syntax to generate content.
Each of the slide functions first argument is the object generated by the sidescroller() function. This tells {sidescroller} to append the slide onto the presentation, so order matters. The output of each slide function is then an updated sidescroller object with the new slide.
Using base R, you could then follow the pattern:
pres <- sidescroller()
pres <- title_slide(pres,title = "Presentation Title",subtitle = "Amazing Subtitle")
pres <- slide_markdown(pres,title = "Slide 1", content = "Slide Content")
However, {sidescroller} has the magrittr pipe function exported, so we can simpify the process:
pres <- sidescroller() %>%
title_slide(pres,
title = "Presentation Title",
subtitle = "Amazing Subtitle") %>%
slide_markdown(pres,
title = "Slide 1",
content = "Slide Content")
In order to save the presenation, use save_sidescroller(), which is a wrapper around save_html() from htmltools.
save_sidescroller(pres,"my_presentation.html")
library(leaflet)
## Warning: package 'leaflet' was built under R version 3.5.3
leaflet() %>% addTiles() %>% setView(-93.65, 42.0285, zoom = 17)
The power of {sidescroller} comes from slick.js by Ken Wheeler combined with some custom jquery and css code.
Many thanks to Ken for developing the image carousel library and making it so flexible.